﻿using System;
using System.Collections;
using System.Collections.Generic;

using System.Text;
using System.Web.UI.WebControls;

namespace Module.Core.BusinessLogic.Advertisement
{
    public class BannerPos
    {
        private int _PosID;
        public int PosID
        {
            get { return _PosID; }
            set { _PosID = value; }
        }
        private string _PosName;
        public string PosName
        {
            get { return _PosName; }
            set { _PosName = value; }
        }
        private string _FileNamXML;
        public string FileNamXML
        {
            get { return _FileNamXML; }
            set { _FileNamXML = value; }
        }

        public class TopLoGo
        {
            public const int PosID = 1;
            public static string PosName = "Top Logo";
            public static string FileNamXML = "TopLogo";

        }
        public class BannerRightHome
        {
            public const int PosID = 2;
            public static string PosName = "Banner phải trang chủ";
            public static string FileNamXML = "BannerRightHome";
        }
        public class BannerCenterHome
        {
            public const int PosID = 3;
            public static string PosName = "Banner giữa trang chủ";
            public static string FileNamXML = "BannerCenterHome";
        }
        public class BannerCenterCM
        {
            public const int PosID = 4;
            public static string PosName = "Banner giữa trang chyên mục";
            public static string FileNamXML = "BannerCenterCM";
        }
        public class BannerLeftCM
        {
            public const int PosID = 5;
            public static string PosName = "Banner hiển thị cột bên trái trang chuyên mục";
            public static string FileNamXML = "BannerLeftCM";
        }
        public class BannerRightCM
        {
            public const int PosID = 6;
            public static string PosName = "Banner hiển thị cột bên phải trang chuyên mục";
            public static string FileNamXML = "BannerRightCM";
        }
        public class BannerFooter1
        {
            public const int PosID = 7;
            public static string PosName = "Banner footer 1";
            public static string FileNamXML = "BannerFooter1";
        }
        public class BannerFooter2
        {
            public const int PosID = 8;
            public static string PosName = "Banner Footer 2";
            public static string FileNamXML = "BannerFooter2";
        }
        public class BannerFooter3
        {
            public const int PosID = 9;
            public static string PosName = "Banner Footer 3";
            public static string FileNamXML = "BannerFooter3";
        }
        public class BannerFooter4
        {
            public const int PosID = 10;
            public static string PosName = "Banner Footer 4";
            public static string FileNamXML = "BannerFooter4";
        }
        public class BannerCenterNhacChuong
        {
            public const int PosID = 11;
            public static string PosName = "Banner hiển thị trang nhạc chuông";
            public static string FileNamXML = "BannerCenterNhacChuong";
        }
        
        
        #region AddDropList
        public static ArrayList Position()
        {
            ArrayList _Position = new ArrayList();

            BannerPos bp = new BannerPos();
            _Position.Clear();

            bp.PosID = TopLoGo.PosID;
            bp.PosName = TopLoGo.PosName;
            bp.FileNamXML = TopLoGo.FileNamXML;
            _Position.Add(bp);

            bp = new BannerPos();
            bp.PosID = BannerRightHome.PosID;
            bp.PosName = BannerRightHome.PosName;
            bp.FileNamXML = BannerRightHome.FileNamXML;
            _Position.Add(bp);

            bp = new BannerPos();
            bp.PosID = BannerCenterHome.PosID;
            bp.PosName = BannerCenterHome.PosName;
            bp.FileNamXML = BannerCenterHome.FileNamXML;
            _Position.Add(bp);

            bp = new BannerPos();
            bp.PosID = BannerCenterCM.PosID;
            bp.PosName = BannerCenterCM.PosName;
            bp.FileNamXML = BannerCenterCM.FileNamXML;
            _Position.Add(bp);

            bp = new BannerPos();
            bp.PosID = BannerLeftCM.PosID;
            bp.PosName = BannerLeftCM.PosName;
            bp.FileNamXML = BannerLeftCM.FileNamXML;
            _Position.Add(bp);

            bp = new BannerPos();
            bp.PosID = BannerRightCM.PosID;
            bp.PosName = BannerRightCM.PosName;
            bp.FileNamXML = BannerRightCM.FileNamXML;
            _Position.Add(bp);

            bp = new BannerPos();
            bp.PosID = BannerFooter1.PosID;
            bp.PosName = BannerFooter1.PosName;
            bp.FileNamXML = BannerFooter1.FileNamXML;
            _Position.Add(bp);

            bp = new BannerPos();
            bp.PosID = BannerFooter2.PosID;
            bp.PosName = BannerFooter2.PosName;
            bp.FileNamXML = BannerFooter2.FileNamXML;
            _Position.Add(bp);

            bp = new BannerPos();
            bp.PosID = BannerFooter3.PosID;
            bp.PosName = BannerFooter3.PosName;
            bp.FileNamXML = BannerFooter3.FileNamXML;
            _Position.Add(bp);
            
            bp = new BannerPos();
            bp.PosID = BannerFooter4.PosID;
            bp.PosName = BannerFooter4.PosName;
            bp.FileNamXML = BannerFooter4.FileNamXML;
            _Position.Add(bp);

            bp = new BannerPos();
            bp.PosID = BannerCenterNhacChuong.PosID;
            bp.PosName = BannerCenterNhacChuong.PosName;
            bp.FileNamXML = BannerCenterNhacChuong.FileNamXML;
            _Position.Add(bp);
            
            
            return _Position;
        }
        public static void Fill(ListControl DropList)
        {
            for (int i = 0; i < Position().Count; i++)
            {
                DropList.Items.Add(new ListItem(((BannerPos)Position()[i]).PosName,
                    ((BannerPos)Position()[i]).PosID.ToString()));
            }
        }
        #endregion

        #region Hàm trả về BannerPos
        public static BannerPos GetPos(int pos)
        {
            for (int i = 0; i < Position().Count; i++)
            {
                if (((BannerPos)Position()[i]).PosID == pos)
                {
                    return ((BannerPos)Position()[i]);
                }
            }
            return null;
        }
        #endregion
    }
}
